<?php $this->load->view('admin/head.php'); ?>
<!--/sidebar-->
<div class="main-wrap">

    <div class="crumb-wrap">
        <div class="crumb-list"><i class="icon-font"></i><a href="<?php echo site_url()?>/admin_login/check">首页</a><span class="crumb-step">&gt;</span><a class="crumb-name" href="<?php echo site_url('admin/recommend/index')?>">有奖游戏管理</a><span class="crumb-step">&gt;</span><span>添加</span></div>
    </div>
    <div class="result-wrap">
        <div class="result-content">
            <form action="<?php echo site_url('admin/recommend/process_add/')?>" method="post" id="myform" name="myform" enctype="multipart/form-data">
                <table class="insert-tab" width="100%">
                    <tbody>
                    <tr>
                        <th><i class="require-red">*</i>标题：</th>
                        <td>
                            <input class="common-text required" id="title" name="title" size="50" value="" type="text">
                        </td>
                    </tr>
                    <tr>
                        <th width="150"><i class="require-red">*</i>分类：</th>
                        <td>
                            <?php if(!empty($category)){ ?>
                                <select name="category_id" id="category_id" class="required">
                                    <?php foreach($category as $key=>$val){?>
                                        <option value="<?php echo $val['id']; ?>"><?php echo $val['title']; ?></option>
                                    <?php } ?>
                                </select>
                            <?php } ?>
                        </td>
                    </tr>

                    <tr>
                        <th><i class="require-red">*</i>游戏描述：</th>
                        <td>
                            <script type="text/javascript" charset="utf-8" src="<?php echo base_url('ueditor/ueditor.config.js')?>"></script>
                            <script type="text/javascript" charset="utf-8" src="<?php echo base_url('ueditor/ueditor.all.min.js')?>"> </script>
                            <!--建议手动加在语言，避免在ie下有时因为加载语言失败导致编辑器加载失败-->
                            <!--这里加载的语言文件会覆盖你在配置项目里添加的语言类型，比如你在配置项目里配置的是英文，这里加载的中文，那最后就是中文-->
                            <script type="text/javascript" charset="utf-8" src="<?php echo base_url('ueditor/lang/zh-cn/zh-cn.js')?>"></script>
                            <script id="container" name="description" type="text/plain" style="width:1024px;height:500px;">
                        </script>
                            <script type="text/javascript">
                                //实例化编辑器
                                //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
                                var ue = UE.getEditor('container');
                            </script>
                        </td>
                    </tr>
                    <tr>
                        <th><i class="require-red">*</i>游戏链接地址：</th>
                        <td>
                            <input class="common-text required" id="url" name="url" size="50" value="" type="text">
                        </td>
                    </tr>
                    <tr>
                        <th width="150"><i class="require-red">*</i>状态：</th>
                        <td>
                            <select name="status" id="status" class="required">
                                <option value="0">正常</option>
                                <option value="1">下架</option>
                            </select>
                        </td>
                    </tr>


                    <tr>
                        <th width="150"><i class="require-red">*</i>操作系统：</th>
                        <td>
                            <select name="type" id="type" class="required"  onchange="system();">
                                <option value="1">android</option>
                                <option value="2">ios</option>
                                <option value="3">windows</option>
                            </select>
                        </td>
                    </tr>

                    <tr id="str" style="display: none;">
                        <th width="150"><i class="require-red">*</i>下载状态：</th>
                        <td>
                            <select name="breakid" id="breakid" class="required">
                                <option value="1">限免</option>
                                <option value="2">越狱</option>
                            </select>
                        </td>
                    </tr>

                    <tr>
                        <th><i class="require-red">*</i>下载大小：</th>
                        <td>
                            <input class="common-text required" id="size" name="size" size="50" value="" type="text">
                            单位：M
                        </td>
                    </tr>

                    <tr>
                        <th><i class="require-red">*</i>排序：</th>
                        <td>
                            <input class="common-text required" id="sort" name="sort" size="50" value="" type="text">
                            排序填写数字，最大的排序在前面
                        </td>
                    </tr>
                    <tr>
                        <th><i class="require-red">*</i>图片：</th>
                        <td>
                            <input type="file" name="picture" />
                        </td>
                    </tr>
                    <tr>
                        <th></th>
                        <td>
                            <input class="btn btn-primary btn6 mr10" value="提交" type="submit">
                            <input class="btn btn6" onclick="history.go(-1)" value="返回" type="button">
                        </td>
                    </tr>
                    </tbody></table>
            </form>
        </div>
    </div>
<script type="text/javascript">
    function system(){
        var type = $('#type').val();

        if(type == 2){
            $('#str').css('display','');
        }else{
            $('#str').css('display','none');
        }
    }
</script>
</div>
<!--/main-->
</div>
</body>
</html>